package com.sina.shop.service.menu;

import com.sina.shop.dao.menu.MenuDao;
import com.sina.shop.domain.menu.Menu;
import com.sina.shop.service.ShopDataSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import static com.sina.shop.service.ServiceConstant.SHOP_TX;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-02-07-11:38
 */
@Service("menuService")
public class MenuServiceImpl extends ShopDataSourceService implements MenuService {

    @Autowired
    @Qualifier("menuDao")
    private MenuDao menuDao;

    @Override
    @Transactional(value = SHOP_TX, isolation = Isolation.READ_COMMITTED, readOnly = true)
    public List<Menu> getMenuList() {
        return menuDao.getMenuList();
    }
}
